package com.metronoteapp;

import android.app.TabActivity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TabHost;

import com.metronoteapp.dialog.AddGroupDialog;

public class GroupExpActivity extends TabActivity{

	private TabHost mLayout;
	private Context mContext;
	private ImageView btnClose;
	private Button btnAddGroup;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.layout_metro_group);

		// Set full Screen activity
		WindowManager.LayoutParams attrs = this.getWindow().getAttributes();
		attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
		this.getWindow().setAttributes(attrs);
		getWindow().setSoftInputMode(
				WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
		this.getWindow().getAttributes().windowAnimations = R.style.DialogAnimation;
		btnAddGroup = (Button) findViewById(R.id.btnAddGroup);
		btnClose = (ImageView) findViewById(R.id.btnCloseGroupNote);

		mContext = this;
		mLayout = getTabHost();
		Intent callExpandNote = new Intent(mContext,
				SettingGroupExpActivity.class);
		mLayout.addTab(mLayout.newTabSpec("two").setIndicator("")
				.setContent(callExpandNote));
		
		btnAddGroup.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				AddGroupDialog newDialogAddGroup = new AddGroupDialog(mContext);
				newDialogAddGroup.displaydialog();
			}
		});
		
		btnClose.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent callMainNote = new Intent(mContext, MainActivity.class);
				callMainNote.putExtra("User", "User 1");
				mContext.startActivity(callMainNote);
			}
		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}
}
